var http=require('http');

var url=require('url')

http.createServer(function (req,res) {
    var urlObj=url.parse(req.url,true);
    var query=urlObj.query;
    res.writeHead(200, {'Content-Type': 'text/html; charset=utf8'});
    if (query.username=='admin'&&query.password=='123456'){
        res.write('登录成功!')
    }else{
        res.write('登录失败!')
    }
    //console.log(urlObj.query)
    res.end();
}).listen(3000)

console.log('the server is running at port 3000');
